<template>
    <div class="mui-numbox" data-numbox-min='1' :data-numbox-max='max'>
        <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
        <input id="test" class="mui-input-numbox" type="number" value="5" @change="numChange()" ref="input"/>
        <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
    </div>
</template>

<script>
import mui from '../../lib/mui/js/mui.min.js'
export default {
    data() {
        return {
            max:''
        }
    },
    methods: {
        numChange(){
            // console.log(this.$refs.input.value)
            this.$emit("changes",parseInt(this.$refs.input.value))
        },
        mounted() {
            mui(".mui-numbox").numbox()
           this.max=mui(".mui-numbox").numbox().setOption('max',10)
        }
    }
}
</script>

<style lang="scss" scoped>
    
</style>